package com.yeswater.multithread.chapter2.test2_1.test8;

import java.util.concurrent.TimeUnit;

/**
 * author : yeswater
 * date : 2023/10/19
 */

public class Sub extends Main{
    synchronized public void operateISubMethod() {
        while (i > 0) {
            try {
                i--;
                System.out.println("sub print i=" + i);
                TimeUnit.MILLISECONDS.sleep(100);
                // Thread.sleep(100);
                super.operateMainMethod();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
